﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using PeachLite.Entity;
using PeachLite.Helpers;
using System.Data.SqlClient;

namespace PeachLite.Admin
{
    public partial class ArticleEdit : DataPage
    {
        protected override string Sql
        {
            get
            {
                string aid = Request.QueryString["aid"] == null ? "" : Request.QueryString["aid"].Trim();
                if (aid != "")
                {
                    try
                    {
                        aid = long.Parse(aid).ToString();
                    }
                    catch
                    {
                        return "";
                    }
                }

                return "sp_Admin_Page_GetArticle '" + aid + "'";
            }
        }

        protected override string[] FormatString
        {
            get
            {
                string[] format = { "<option value='{0}'>{1}</option>",
                                  "<li class='item'><div class='cn'><input type='hidden' class='pid' value='{0}'/><img class='pic' src='/u/image/a/{1}' title='{2}' alt='{3}' /><div class='tit clearfix'><span class='ptit'>{4}</span><span class='od'>（<b class='pod'>{5}</b>）</span><div class='o'><input class='btn edit' type='button' value='&#xf040;' onclick='openEditor(this);'/><input class='btn del' type='button' value='&#xf00d;' onclick='delp(this);'/></div></div><div class='pdes'>{6}</div></div></li>"};
                return format;
            }
        }
    }
}